package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingLevelPageQueryDto;
import com.zzyl.entity.NursingLevel;
import com.zzyl.vo.NursingLevelVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingLevelMapper {

    /**
     * 分页条件查询护理等级
     * @param dto
     * @return
     */
    Page<NursingLevelVo> pageQuery(NursingLevelPageQueryDto dto);

    /**
     * 新增护理等级
     * @param nursingLevel
     */
    void insert(NursingLevel nursingLevel);

    /**
     * 根据ID查询护理等级
     * @param id
     * @return
     */
    @Select("select * from nursing_level where id = #{id} ;")
    NursingLevel getById(Long id);

    /**
     * 删除护理等级
     * @param id
     */
    @Delete("delete from nursing_level where id = #{id}")
    void deleteById(Long id);

    /**
     * 修改护理等级的状态
     * @param nursingLevel
     */
    void update(NursingLevel nursingLevel);

    /**
     * 查询所有护理等级
     * @return
     */
    @Select("select * from nursing_level where status = 1 ")
    List<NursingLevel> list();
}
